#include<cstdio>
#include<ctime>
#include<algorithm>

int main()
{
	srand(time(0));
	printf("1\n");

	int n, m, a, b;
	n = rand()%10+1;
	m = rand()%10+1;
	a = rand()%n+1;
	b = rand()%m+1;

	printf("%d %d %d %d\n", n, m, a, b);
	for(int i=1; i<=n; ++i)
	{
		for(int j=1; j<=m; ++j)
		{
			int temp = rand()%3;
			printf("%d ",temp);
		}
		printf("\n");
	}

	return 0;
}
